﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace Daco.Web
{
    public class Global : System.Web.HttpApplication
    {

        public Global()
        {
            this.Error += new EventHandler(Global_Error);
        }

        void Global_Error(object sender, EventArgs e)
        {
#if DEBUG
            Session["UnhandledException"] = Server.GetLastError().InnerException == null ? Server.GetLastError() : Server.GetLastError().InnerException;
#else
            Session["UnhandledException"] = Server.GetLastError();
#endif
        }

        protected void Session_OnStart()
        {
        }
    }
}